import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // 全局css样式
import customUi from './styles/element-ui'
import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
import VueCropper from 'vue-cropper' // 截图插件
// import message from '@/utils/resetMessage';
import * as filters from './filters'
import VueClipboard from 'vue-clipboard2' // 复制内容插件

Vue.use(VueClipboard)
Vue.use(VueCropper)
Vue.prototype.$customUi = customUi

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}

// 英文版
// Vue.use(ElementUI, { locale })

// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI, {
  // 设置全局大小
  size: 'mini'
})
// //重写message提示框  一定要放在Vue.use(ElementUI)之后
// Vue.prototype.$message = message;

// 全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
